//  @ Project : GagalPanen
//  @ File Name : fruit.cpp
//  @ Date : 3/9/2011
//  @ Author : Denis
//
//


#include "fruit.hpp"

Fruit::Fruit(GameInterface* game, int fruit_id) :
    Item(game) {
  fruit_id_ = fruit_id;
}

Fruit::Fruit(GameInterface* game, std::ifstream& is) :
    Item(game, is) {
  is >> fruit_id_;
}

void Fruit::save(std::ofstream& os) {
  Item::save(os);
  os << fruit_id_ << std::endl;
}

Fruit::~Fruit() {}

int Fruit::getId() {
  return fruit_id_;
}

ItemType Fruit::getType() {
  return kFruit;
}

bool Fruit::isSeed() {
  return false;
}

std::string Fruit::getName() {
  return FruitConstants::getFruitName(getId());
}

int Fruit::getPrice() {
  return FruitConstants::getFruitSellPrice(getId());
}

std::string Fruit::getDescription() {
  return FruitConstants::getFruitDescription(getId());
}

void Fruit::eat() {
  FruitConstants::eatFruit(game_, getId());
}
